<?php
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use yii\helpers\Url;
use app\assets\MuiAsset;

MuiAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>

<body>
    <?php $this->beginBody() ?>
    
    <?= $content ?>
   
    <?php $this->endBody() ?>

<?php app\components\JsBlock::begin() ?>
<script>   
	 var login = localStorage.getItem("login");
	 var passwd = localStorage.getItem("passwd");
	 if(login != '' && passwd !=''){
	 	   	$.ajax({
	           type: "post",
	           async:false, 
	           url: "/member/member/auto-login",
	           data: {'login-form[login]':login,'login-form[password]':passwd,},
	           success: function(res){
	           	    var res = $.parseJSON(res);
	                if(res.code == 0){
	                	return false;
	                }else if(res.code == 1){
	                	window.location.reload(); 
	                }
	           }
    		});
	 }
	
</script>
<?php app\components\JsBlock::end() ?>

</body>
</html>
<?php $this->endPage() ?>
